﻿<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="en" class="no-js">

<head>

  <meta charset="utf-8">
  <title>Login</title>
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta name="description" content="">
  <meta name="author" content="">

  <!-- CSS -->
  <link rel="stylesheet" href="${pageContext.request.contextPath}/assets/css/reset.css">
  <link rel="stylesheet" href="${pageContext.request.contextPath}/assets/css/supersized.css">
  <link rel="stylesheet" href="${pageContext.request.contextPath}/assets/css/style.css">


  <!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
  <!--[if lt IE 9]>
  <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
  <![endif]-->

  <script type="text/javascript">
      function rsalogin(){
          var thisPwd = document.getElementById("login_password").value;
          //alert(thisPwd);
          //bodyRSA();
          //var result = encryptedString(key, encodeURIComponent(thisPwd));
          //alert(encodeURIComponent(thisPwd)+"\r\n"+result);
          $("#login_password").attr("value",thisPwd);
          document.getElementById("formid").submit();
      }
      var key ;
      function bodyRSA(){
          setMaxDigits(130);
          key = new RSAKeyPair("10001","","a1be9319d13fae8a0bb6ea5823df10ea3a2f2e085e8f904fa199aefecfaa61fac16ef7ebedb56943f7874b0ad2511d3ca22f6cec5bd827c11200c47c2a7323eb");
      }

      function hello(){

          window.location.href='${pageContext.request.contextPath}/home/register';
      }
  </script>

</head>

<body>

<div class="page-container">
  <h1>Login</h1>
  <form id="formid" action="${pageContext.request.contextPath}/home/login" method="post">
    <input type="text" id="login_name" name="login_name" class="username" placeholder="账号">
    <input type="password" id="login_password" name="login_password" class="password" placeholder="密码">
    <button type="button" onclick="rsalogin()" >登录</button>
    <button type="button" onclick="hello()" >注册</button>
    <div class="error"><span>+</span></div>
  </form>
  <div class="connect">
    <p>使用其他登录方式</p>
    <p>
      <a class="facebook" href=""></a>
      <a class="twitter" href=""></a>
    </p>
  </div>
</div>

<!-- Javascript -->
<script src="${pageContext.request.contextPath}/assets/js/jquery-1.8.2.min.js"></script>
<script src="${pageContext.request.contextPath}/assets/js/supersized.3.2.7.min.js"></script>
<script src="${pageContext.request.contextPath}/assets/js/supersized-init.js"></script>
<script src="${pageContext.request.contextPath}/assets/js/scripts.js"></script>
<script src="${pageContext.request.contextPath}/assets/js/RSA.js"></script>
<script src="${pageContext.request.contextPath}/assets/js/BigInt.js"></script>
<script src="${pageContext.request.contextPath}/assets/js/Barrett.js"></script>
</body>

</html>

